home *** CD-ROM | disk | FTP | other *** search
- /*
- GEClearWorld.c
-
- Utility to clear a Graphic Elements world of all elements for reuse
-
- Copyright 1995 by Al Evans. All rights reserved.
-
- 3/27/95
-
- */
-
- #include "GEClearWorld.h"
- #include "Rects.h"
- #include "GEWorldManager.h"
-
- void ClearGEWorld(GEWorldPtr world)
- {
- Boolean wasActive = world->active;
- Boolean wasOnWorldList = world->onWorldList;
-
- if (wasActive)
- ActivateWorld(world, false);
- if (wasOnWorldList)
- DeleteFromWorldList(world);
- while (world->idList)
- DisposeGrafElement(world, world->idList->objectID);
- ClearRectList(world->activeRectList);
- ClearRectList(world->safeRectList);
- ClearList(world->sensorList);
- RectRgn(world->clipRgn, &world->animationRect);
- if (wasOnWorldList)
- AddToWorldList(world);
- if (wasActive)
- ActivateWorld(world, true);
-
- }
-
-